package com.yxy.utils;

import java.util.Random;

public class RandomNickNameUtil {

    private static final String CHARACTERS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";

    public static String generateRandomNickName() {
        StringBuilder sb = new StringBuilder("访客");
        for (int i = 0; i < 8; i++) {
            Random random = new Random();
            char c = CHARACTERS.charAt(random.nextInt(CHARACTERS.length()));
            sb.append(c);
        }
        return sb.toString();
    }
}
